<template>
  <div>
    <h1>{{msg}}</h1>
    <a href="javascript:;" @click="createComponent">Create Component</a>
    <!-- <app-org-list></app-org-list> -->
    <ul>
      <li :is="item.component" :text="item.text" v-for="item in items"></li>
    </ul>
  </div>
</template>

<script>
import orglist from './OrgList.vue'

export default {
  data () {
    return {
      msg: 'org',
      items: []
    }
  },
  components:{
    appOrgList: orglist
  },
  methods: {
    createComponent() {
      this.items.push({
        'component': 'appOrgList',
        'text': Math.random()
      })
    }
  },
  mounted: function() {
    console.log(this.$store.state.username);
  }
}
</script>


<style scoped>

</style>
